package com.test.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
public class Car  extends IdentifiableEntity<Long>  {


    private String name;

    @ManyToOne(cascade = CascadeType.PERSIST,fetch= FetchType.LAZY)
    @JoinColumn(name = "room_id")
    private CarRoom room;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public CarRoom getRoom() {
        return room;
    }

    public void setRoom(CarRoom room) {
        this.room = room;
    }
}